@extends('admin.common.layouts')

@section('style')
 <link href="{{URL::asset('css/custom.min.css')}}" rel="stylesheet">

    <style>
        .abtn a{
            color:#fff;
            line-height:20px;
        }
        .abtn a:hover{
            color:#fff;
            text-decoration:none;
        }
    </style>
@show

@section('content_header')

@show

@section('content')
  <div class="col-md-12">
    <div class="box">
      <!-- 栏目信息 -->
      <div class="box-header with-border">
        <h3 class="box-title">网址管理</h3>
      </div>

      <!-- 内容 -->
      <div class="box-body">
        <div class="x_content">
          <form method="post" action="{{url('admin/site/editForm',['id' => $site->id])}}" class="form-horizontal form-label-left" novalidate>
            {{ csrf_field() }}
            <div class="item form-group">
              <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">网站名 <span class="required">*</span>
              </label>
              <div class="col-md-6 col-sm-6 col-xs-12">
                <input id="name"  value="{{$site->name}}" class="form-control col-md-7 col-xs-12" data-validate-length-range="6" data-validate-words="2" name="name" placeholder="xxx" required="required" type="text">
              </div>
            </div>
            
            <div class="item form-group">
              <label class="control-label col-md-3 col-sm-3 col-xs-12" for="website">网站 URL <span class="required">*</span>
              </label>
              <div class="col-md-6 col-sm-6 col-xs-12">
                <input type="url" id="website" name="website" value="{{$site->url}}" required="required" placeholder="http://www.website.com" class="form-control col-md-7 col-xs-12">
              </div>
            </div>

            <div class="item form-group">
              <label class="control-label col-md-3 col-sm-3 col-xs-12">所属类别</label>
              </label>
              <div class="col-md-6 col-sm-6 col-xs-12">
                  <select class="form-control" name="groupId">
                      @foreach($groups as $group)
                      <option value="{{$group->id}}" 
                      @if($group->id == $site->group_id)
                      selected
                      @endif
                      >{{$group->name}}</option>
                      @endforeach
                  </select>
              </div>
            </div>
            
            <div class="ln_solid"></div>
            <div class="form-group">
              <div class="col-md-6 col-md-offset-3">
                <a href="\admin\site"><button type="button" class="btn btn-primary abtn">返回</button></a>
                <button id="send" type="submit" class="btn btn-success">提交</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
@endsection